# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mkyara
_pkgname=mkYARA
pkgver=3.8147f91
pkgrel=9
pkgdesc='Tool to generate YARA rules based on binary code.'
groups=('blackarch' 'blackarch-misc')
arch=('any')
url='https://github.com/fox-it/mkYARA'
license=('GPL3')
depends=('python' 'python-capstone' 'python-yara-python-dex' 'python-argparse')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/fox-it/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $_pkgname

  python setup.py build
}

package() {
  cd $_pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

